Account Book
AccountBook is the overall container for a data file in Moneydance. It contains references to all transactions, accounts, currencies, securities, budgets, etc.
Properties
The set of currencies associated with this file
Returns true if the current file has been created from a sync source but has not yet retrieved a full copy of the data set.
Returns an object that can be used to save information locally, such as preferences, network/syncing settings, and passwords (if the data file is encrypted). Note: data put into the local storage is not synced.
Tells the model whether all account balances should be recalculated whenever a transaction is modified. For performance reasons this should be set to false before adding/modifying/deleting a bunch of transactions and then set to true afterwards. DON'T FORGET TO SET TO TRUE WHEN DONE WITH THE OPERATION!!!!
Get the set of all transactions.
The undo manager that is associated with the data file, if one has been set by the UI
Functions
add a listener to be notified when an account is modified.
Add a file listener, but only if it is not already listening for file events in this AccountBook
Add a listener to this AccountBook, but only if it is not already in the list of listeners
Load the set of accounts from storage
Lookup an account by either it's old account ID (if given a numeric value) or by it's UUID.
Returns the local item that has the given ID
Record that the given item was changed, so that the change can be saved and synced.
Record that the given items were changed, so that the changes can be saved and synced.
Record that the given item was removed, so that the removal of the item can be synced.
Move this account book to the given base folder. This is used for internal functions such as moving a provisional set of data from a temporary folder into it's permanent location.
notify all listeners that the specified account has been added.
notify all listeners that the specified account has been deleted.
notify all listeners that the specified account has been modified.
notify all listeners that a balance in the specified account has changed.
Validates the AccountBook's data structure, including account hierarchy, presence of a single root account, currency snapshot references, and more. This will skip some checks if isFinishedInitialLoad is false, because it means the entire data set is not yet loaded and automatic corrections shouldn't be made. So the file loader should ensure that this method is called at least once after isFinishedInitialLoad is set to true.
enqueue this object to be stored and synced, but don't save/sync it immediately because changes are likely right around the corner.
This will update the accounts balance from the "working" value and notify listeners if the balance has changed. Returns true if any of the balances have changed.
Call this to add an item to the data set that is not yet synced. This should only be called when loading data in bulk. After this is called you should push a new trunk data set to the syncing system so that this item is not lost!
remove the specified object so that it doesn't get any more notifications when an account is modified.
Saves a snapshot of the current data set in a "trunk" data file. If the resetTxnQueue parameter is true then any incremental transaction logs since the last save are wiped out. Therefore, the parameter should only be true if we're the master syncing node AND ve created a new data file for the first time or we want to reset the transaction queue for some other reason.
If the syncing process hasn't already been established then this synchronously downloads the initial data set. It then kicks off a background thread to continuously sync this data file. If syncing has already started this does nothing.